﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
using System.Collections;

/// <summary>
///sqlSelect 的摘要说明
///Author:Andrew
///Date:2011-10-18
///简单的查询语句集合
/// </summary>
public class sqlSelect
{
	public sqlSelect()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
	}
    public bool Login(string userName, string userPass)
    {
        bool result = false;
        SqlConnection sqlCon = new SqlConnection(ConfigurationManager.AppSettings["SQLConnection"]);
        string conStr = "SELECT 用户名,密码 FROM dbo.T_系统_用户表";
        sqlCon.Open();
        SqlCommand sqlCom = new SqlCommand(conStr, sqlCon);
        SqlDataReader sqlDr = sqlCom.ExecuteReader();
        if (sqlDr.Read())
        {
            return result = true;
        }
        else
        {
            return result = false;
        }
    }

    class purviewLst
    {
        int menuID {get;set;}
        string menuName {get;set;}
        int menuFartherID {get;set;}
    }
    //public List<purviewLst> Purview(string tvName)
    //{
    //    List<purviewLst> lstInfo = new List<purviewLst>();
    //    //purviewLst lst = new purviewLst();
    //    SqlConnection sqlCon = new SqlConnection(ConfigurationManager.AppSettings["SQLConnection"]);
    //    string conStr = "P_系统_获取用户权限";
    //    sqlCon.Open();
    //    SqlCommand sqlCom = new SqlCommand(conStr, sqlCon);
    //    sqlCom.CommandType = CommandType.StoredProcedure;
    //    sqlCom.Parameters.Add(new SqlParameter("@用户名", SqlDbType.VarChar, 20));
    //    sqlCom.Parameters["@用户名"].Value = tvName;
    //    SqlDataReader sqlDr = sqlCom.ExecuteReader();
    //    while (sqlDr.Read())
    //    {
    //        //lstInfo.Add(sqlDr["菜单代码"].ToString());
    //        //lstInfo.Add(sqlDr["菜单名称"].ToString());
    //        //lstInfo.Add(sqlDr["父菜单代码"].ToString());
    //    }
    //        return lstInfo;
    //}
}